package com.storage.business
{
	import com.firemoss.modelglue.service.AsynchronousOperationHelper;
	import com.firemoss.modelglue.service.ServiceLocator;
	import com.storage.vo.query.QueryInfoVO;
	
	import mx.rpc.AbstractService;
	
	public class CommonDelegate implements ICommonDelegate
	{
		public function CommonDelegate()
		{
		}
		private var serivce:AbstractService = ServiceLocator.getInstance().getService("commonService");
		public function loadAll(entityName:String, resultCallbackFunction:Function,fualtHandler:Function):void
		{
			var helper:AsynchronousOperationHelper = new 
						AsynchronousOperationHelper(serivce.loadAll(entityName),resultCallbackFunction,fualtHandler);
							
		}
		
		public function findByPropertyInit(className:String, property:String, value:String, 
						initProps:Array, resultCallbackFunction:Function):void
		{
			var helper:AsynchronousOperationHelper = new 
						AsynchronousOperationHelper(serivce.findByPropertyInit(className,property,value,initProps)
						,resultCallbackFunction);	
		}
		
		
		
		public function findByQuery(queryinfo:QueryInfoVO,resultCallbackFunction:Function,fualtHandler:Function):void{
			var helper:AsynchronousOperationHelper = new 
						AsynchronousOperationHelper(serivce.findByQuery(queryinfo)
						,resultCallbackFunction,fualtHandler);	
		}
	}
}